package o;

import android.graphics.Matrix;
import android.graphics.Rect;
import android.os.Build.VERSION;
import android.util.Log;
import android.util.Property;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import java.lang.reflect.Field;

public class oi {
    private static Field ˊ;
    private static boolean ˋ;
    public static final Property<View, Rect> ˎ = new Property<View, Rect>(Rect.class, "clipBounds") {
        public /* synthetic */ Object get(Object obj) {
            return ˎ((View) obj);
        }

        public /* synthetic */ void set(Object obj, Object obj2) {
            ˎ((View) obj, (Rect) obj2);
        }

        public Rect ˎ(View view) {
            return ViewCompat.ˉ(view);
        }

        public void ˎ(View view, Rect rect) {
            ViewCompat.ˎ(view, rect);
        }
    };
    private static final oo ˏ;
    public static final Property<View, Float> ॱ = new Property<View, Float>(Float.class, "translationAlpha") {
        public /* synthetic */ Object get(Object obj) {
            return ॱ((View) obj);
        }

        public /* synthetic */ void set(Object obj, Object obj2) {
            ॱ((View) obj, (Float) obj2);
        }

        public Float ॱ(View view) {
            return Float.valueOf(oi.ॱ(view));
        }

        public void ॱ(View view, Float f) {
            oi.ˋ(view, f.floatValue());
        }
    };

    static {
        if (VERSION.SDK_INT >= 22) {
            ˏ = new om();
        } else if (VERSION.SDK_INT >= 21) {
            ˏ = new of();
        } else if (VERSION.SDK_INT >= 19) {
            ˏ = new oh();
        } else {
            ˏ = new oo();
        }
    }

    public static og ˋ(@NonNull View view) {
        if (VERSION.SDK_INT >= 18) {
            return new oj(view);
        }
        return ob.ˋ(view);
    }

    public static or ˏ(@NonNull View view) {
        if (VERSION.SDK_INT >= 18) {
            return new on(view);
        }
        return new ok(view.getWindowToken());
    }

    public static void ˋ(@NonNull View view, float f) {
        ˏ.ˋ(view, f);
    }

    public static float ॱ(@NonNull View view) {
        return ˏ.ॱ(view);
    }

    public static void ˎ(@NonNull View view) {
        ˏ.ˊ(view);
    }

    public static void ˊ(@NonNull View view) {
        ˏ.ˎ(view);
    }

    public static void ˏ(@NonNull View view, int i) {
        ˊ();
        if (ˊ != null) {
            try {
                ˊ.setInt(view, (ˊ.getInt(view) & -13) | i);
            } catch (IllegalAccessException e) {
            }
        }
    }

    public static void ˊ(@NonNull View view, @NonNull Matrix matrix) {
        ˏ.ˊ(view, matrix);
    }

    public static void ॱ(@NonNull View view, @NonNull Matrix matrix) {
        ˏ.ॱ(view, matrix);
    }

    public static void ˋ(@NonNull View view, @Nullable Matrix matrix) {
        ˏ.ˋ(view, matrix);
    }

    public static void ˋ(@NonNull View view, int i, int i2, int i3, int i4) {
        ˏ.ॱ(view, i, i2, i3, i4);
    }

    private static void ˊ() {
        if (!ˋ) {
            try {
                ˊ = View.class.getDeclaredField("mViewFlags");
                ˊ.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.i("ViewUtils", "fetchViewFlagsField: ");
            }
            ˋ = true;
        }
    }
}
